<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>sessionCount内置对象计数器</title>
    <style>
        h1{
            color: red;
            text-align: center;
            size: 7px;
        }
        p{
            color: green;
            text-align: center;
            size: 5px;
        }
    </style>
</head>
<body>
<%!int Num = 0;%>
<%
if(session.isNew()){
Num+=1;
session.setAttribute("Num",Num);//将Num变量值存入session中
}
%>
<h1>sessionCount内置对象计数器</h1>
<p>
    您是第<%=session.getAttribute("Num")%>位访问者
</p>
</body>
</html>